#ifndef __AOT_DATA_OP_RECENT_CHAT_OP_H__    
#define __AOT_DATA_OP_RECENT_CHAT_OP_H__

#include "interface/data_op/recent_chat.h"

namespace aot{ namespace data{

class recent_chat_info_impl : public irecent_chat_info
{
public:
    virtual ~recent_chat_info_impl(){;}
    recent_chat_info_impl()
    {
        chat_type = 0;

        session_id = &session_id_impl;
        time = &time_impl;
       
    }
public:
    virtual  bool clone(irecent_chat_info** out) 
    {
        recent_chat_info_impl* p = new recent_chat_info_impl();
        *out = p;
        return p->assign(this);
    }
    virtual  bool assign(const irecent_chat_info* in) 
    {
        if ( NULL == in )
            return false;

        recent_chat_info_impl* p = (recent_chat_info_impl*) in;
        *this = *p;

        session_id = &session_id_impl;
        time = &time_impl;
        return true;
    }
public:
    aot::tt::str_impl session_id_impl;
    aot::tt::str_impl time_impl;
};

class recent_chat_op_impl : public irecent_chat_op
{
public:
    recent_chat_op_impl(void);
    virtual ~recent_chat_op_impl(void);
public:
	bool del(const char* session_id);
    bool del_all();
    bool insert_recent_chat_info(irecent_chat_info* p);
    bool get_recent_chat_info_list(isqlite3_table** out);
};

}} /// end namespace aot/data
#endif /// __AOT_DATA_OP_RECENT_CHAT_OP_H__
